```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java I/O 流操作指南</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background-color: #2d3748;
            border-radius: 0.5rem;
            position: relative;
        }
        .code-block pre {
            margin: 0;
            padding: 1.5rem;
            overflow-x: auto;
        }
        .code-block .copy-btn {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            background: rgba(255,255,255,0.1);
            border: none;
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .code-block .copy-btn:hover {
            background: rgba(255,255,255,0.2);
        }
        .card {
            transition: transform 0.3s, box-shadow 0.3s;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .concept-map {
            background-color: #f8fafc;
            border-radius: 0.5rem;
            padding: 2rem;
        }
        .text-gradient {
            background: linear-gradient(90deg, #6e8efb, #a777e3);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6">Java I/O 流操作指南</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">掌握标准输入输出的精髓，提升Java编程效率</p>
            <div class="flex justify-center space-x-4">
                <a href="#output" class="px-6 py-3 bg-white text-purple-600 font-medium rounded-lg hover:bg-opacity-90 transition">输出流</a>
                <a href="#input" class="px-6 py-3 bg-white text-purple-600 font-medium rounded-lg hover:bg-opacity-90 transition">输入流</a>
                <a href="#redirect" class="px-6 py-3 bg-white text-purple-600 font-medium rounded-lg hover:bg-opacity-90 transition">重定向</a>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl py-12 px-4">
        <!-- Concept Map -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-center text-gradient">Java I/O 概念图谱</h2>
            <div class="concept-map">
                <div class="mermaid">
                    graph TD
                        A[System类] --> B[out: PrintStream]
                        A --> C[in: InputStream]
                        B --> D[标准输出]
                        C --> E[标准输入]
                        D --> F[write/print/println]
                        E --> G[read]
                        A --> H[setOut/setIn]
                        H --> I[重定向]
                </div>
            </div>
        </section>

        <!-- Output Stream Section -->
        <section id="output" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center mr-4">
                    <i class="fas fa-terminal text-purple-600 text-xl"></i>
                </div>
                <h2 class="text-3xl font-bold">OutputStream 输出</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold mb-4 text-purple-600 flex items-center">
                        <i class="fas fa-info-circle mr-2"></i> 基础概念
                    </h3>
                    <p class="text-gray-700 mb-4">System.out 是 Java 中的标准输出流，它是 PrintStream 类的实例。通过该对象可以向控制台输出信息。</p>
                    <p class="text-gray-700">使用 <code class="bg-gray-100 px-1 py-0.5 rounded">write()</code> 方法时需要注意，它接受的是字节数组参数，通常需要先调用字符串的 <code class="bg-gray-100 px-1 py-0.5 rounded">getBytes()</code> 方法进行转换。</p>
                </div>
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold mb-4 text-purple-600 flex items-center">
                        <i class="fas fa-lightbulb mr-2"></i> 使用建议
                    </h3>
                    <ul class="list-disc pl-5 text-gray-700 space-y-2">
                        <li>更推荐使用 <code class="bg-gray-100 px-1 py-0.5 rounded">print()</code> 或 <code class="bg-gray-100 px-1 py-0.5 rounded">println()</code> 方法</li>
                        <li>使用后及时关闭流释放资源</li>
                        <li>注意异常处理</li>
                        <li>对于大量输出考虑使用缓冲</li>
                    </ul>
                </div>
            </div>

            <h3 class="text-2xl font-semibold mb-4 flex items-center">
                <i class="fas fa-code mr-2 text-gray-500"></i> 代码示例
            </h3>
            <div class="code-block mb-8">
                <button class="copy-btn" onclick="copyCode(this)">
                    <i class="far fa-copy mr-1"></i>复制
                </button>
                <pre class="text-gray-200"><code>public class Tese01 {
    public static void main(String[] args) throws Exception {
        PrintStream out = System.out;    // System.out是PrintStream的对象
        out.write("hello world".getBytes());
        out.close();
    }
}</code></pre>
            </div>
        </section>

        <!-- Redirect Section -->
        <section id="redirect" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4">
                    <i class="fas fa-exchange-alt text-blue-600 text-xl"></i>
                </div>
                <h2 class="text-3xl font-bold">输出重定向</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold mb-4 text-blue-600 flex items-center">
                        <i class="fas fa-info-circle mr-2"></i> 重定向原理
                    </h3>
                    <p class="text-gray-700 mb-4">通过 <code class="bg-gray-100 px-1 py-0.5 rounded">System.setOut()</code> 方法可以将标准输出重定向到文件或其他输出目标。</p>
                    <p class="text-gray-700">重定向后，所有通过 <code class="bg-gray-100 px-1 py-0.5 rounded">System.out</code> 的输出都将写入到新的目标，而不是控制台。</p>
                </div>
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold mb-4 text-blue-600 flex items-center">
                        <i class="fas fa-exclamation-triangle mr-2"></i> 注意事项
                    </h3>
                    <ul class="list-disc pl-5 text-gray-700 space-y-2">
                        <li>重定向前保存原始输出流以便恢复</li>
                        <li>注意文件路径权限问题</li>
                        <li>多线程环境下需谨慎使用</li>
                        <li>重定向会影响整个应用程序的输出</li>
                    </ul>
                </div>
            </div>

            <h3 class="text-2xl font-semibold mb-4 flex items-center">
                <i class="fas fa-code mr-2 text-gray-500"></i> 输出重定向示例
            </h3>
            <div class="code-block mb-8">
                <button class="copy-btn" onclick="copyCode(this)">
                    <i class="far fa-copy mr-1"></i>复制
                </button>
                <pre class="text-gray-200"><code>public class Tese01 {
    public static void main(String[] args) throws Exception {
        PrintStream ps = new PrintStream(new File("F:/file.txt"));
        System.setOut(ps);   // 这里重定向了，不会打印在控制台，而是打印在file.txt中
        ps.print("hello");
        ps.println("world");
        System.out.println("重定向");
        ps.close();
    }
}</code></pre>
            </div>
        </section>

        <!-- Input Stream Section -->
        <section id="input" class="mb-16">
            <div class="flex items-center mb-8">
                <div class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mr-4">
                    <i class="fas fa-keyboard text-green-600 text-xl"></i>
                </div>
                <h2 class="text-3xl font-bold">System.in 输入</h2>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-8">
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold mb-4 text-green-600 flex items-center">
                        <i class="fas fa-info-circle mr-2"></i> 基本概念
                    </h3>
                    <p class="text-gray-700 mb-4">System.in 是标准输入流，通常对应键盘输入。它是 InputStream 类型的对象，可以通过它读取用户输入的数据。</p>
                    <p class="text-gray-700">read() 方法会阻塞程序执行，直到有输入可用。对于控制台输入，通常需要按回车键确认。</p>
                </div>
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-xl font-semibold mb-4 text-green-600 flex items-center">
                        <i class="fas fa-lightbulb mr-2"></i> 实用技巧
                    </h3>
                    <ul class="list-disc pl-5 text-gray-700 space-y-2">
                        <li>通常与 Scanner 或 BufferedReader 搭配使用</li>
                        <li>注意字符编码问题</li>
                        <li>考虑使用readLine()读取整行</li>
                        <li>实现输入终止条件(如本例中的"exit")</li>
                    </ul>
                </div>
            </div>

            <h3 class="text-2xl font-semibold mb-4 flex items-center">
                <i class="fas fa-code mr-2 text-gray-500"></i> 键盘输入示例
            </h3>
            <div class="code-block mb-8">
                <button class="copy-btn" onclick="copyCode(this)">
                    <i class="far fa-copy mr-1"></i>复制
                </button>
                <pre class="text-gray-200"><code>public class Tese01 {
    public static void main(String[] args) throws Exception {
        boolean flag = true;
        byte[] by = new byte[1024];
        while (flag) {
            InputStream input = System.in;
            int read = input.read(by, 0, by.length);
            String string = new String(by, 0, read-1);
            System.out.println(string);
            if ("exit".equals(string.trim())) {
                System.exit(1);
            }
        }
    }
}</code></pre>
            </div>

            <h3 class="text-2xl font-semibold mb-4 flex items-center">
                <i class="fas fa-code mr-2 text-gray-500"></i> 输入重定向示例
            </h3>
            <div class="code-block">
                <button class="copy-btn" onclick="copyCode(this)">
                    <i class="far fa-copy mr-1"></i>复制
                </button>
                <pre class="text-gray-200"><code>public class Tese01 {
    public static void main(String[] args) throws Exception {
        System.setIn(new FileInputStream("F:/file.txt"));     // 设置输入重定向
        InputStream input = System.in;   // 从文件中接受数据
        byte[] by = new byte[1024];          
        int read = input.read(by);
        System.out.println(new String(by,0,read));
        input.close();
    }
}</code></pre>
            </div>
        </section>

        <!-- Summary Section -->
        <section class="bg-indigo-50 p-8 rounded-xl mb-16">
            <h2 class="text-2xl font-bold mb-6 text-indigo-700 text-center">关键知识点总结</h2>
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-white p-5 rounded-lg shadow-sm">
                    <div class="text-indigo-600 mb-3 text-4xl">
                        <i class="fas fa-stream"></i>
                    </div>
                    <h3 class="font-semibold text-lg mb-2">I/O流分类</h3>
                    <p class="text-gray-600">Java中的I/O流分为字节流和字符流，System.in/out属于字节流，处理原始字节数据。</p>
                </div>
                <div class="bg-white p-5 rounded-lg shadow-sm">
                    <div class="text-indigo-600 mb-3 text-4xl">
                        <i class="fas fa-random"></i>
                    </div>
                    <h3 class="font-semibold text-lg mb-2">重定向机制</h3>
                    <p class="text-gray-600">通过setIn/setOut可以灵活改变标准输入输出的目标，实现与文件或其他设备的交互。</p>
                </div>
                <div class="bg-white p-5 rounded-lg shadow-sm">
                    <div class="text-indigo-600 mb-3 text-4xl">
                        <i class="fas fa-bug"></i>
                    </div>
                    <h3 class="font-semibold text-lg mb-2">异常处理</h3>
                    <p class="text-gray-600">I/O操作需要处理IOException，特别是文件操作时要注意权限和路径问题。</p>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">专注编程技术分享</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="hover:text-white transition flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i> 访问语雀主页
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-6 pt-6 text-sm text-center text-gray-500">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        // 初始化Mermaid图表
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });

        // 复制代码功能
        function copyCode(button) {
            const codeBlock = button.parentElement;
            const code = codeBlock.querySelector('code').innerText;
            navigator.clipboard.writeText(code).then(() => {
                button.innerHTML = '<i class="fas fa-check mr-1"></i>已复制';
                setTimeout(() => {
                    button.innerHTML = '<i class="far fa-copy mr-1"></i>复制';
                }, 2000);
            });
        }

        // 平滑滚动
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>
```